package com.ming.springcloud.student.dao;

import java.util.List;
import java.util.Optional;
import com.ming.springcloud.student.pojo.StudentEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository("studendDao")
public interface IStudendDao extends JpaRepository<StudentEntity, Integer>{
	/**
	 * 根据id删除
	 * @param id
	 */
	@Transactional
	void deleteById(Integer id);
    /**
     * 根据id查询所有
     * @param id
     * @return
     */
	@Transactional
	Optional<StudentEntity> findById(Integer id);
     /**
      * 根据项目名称模糊查询
      * @param name
      * @return
      */
	@Transactional
	List<StudentEntity> findBystuNameLike(String name);

	@Override
	List<StudentEntity> findAll();
}
